class CurrencyController < ApplicationController
  before_filter :authenticate_user!

  def render_currencies_list
    respond_to do |format|
      format.html
      format.xml { render :xml => @currencies }
      format.json { render :json => @currencies.as_json }
    end
  end

  def index
    @currencies = current_user.currencies_codes

    render_currencies_list()
  end

  def all_codes
    @currencies = Currency.all.map {|c| c.code}

    render_currencies_list()
  end

end
